package com.clkj.goldpartner.dao;

import com.clkj.goldpartner.pojo.StockInfo;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @author 杨行
 * @date 2021/3/2 15:36
 */
@Repository
public interface StockInfoMapper extends Mapper<StockInfo> {

    /**
     * 获取指定的库存记录
     *
     * @param stock_status
     * @param stock_num
     * @return
     */
    @Select("select a.*,b.*,c.category_name from t_cl_stockInfo a left join t_cl_goods b on a.goods_id = b.goods_id left join t_cl_category c on c.category_id = b.category_id where a.stock_status = #{stock_status} and a.stock_num = #{stock_num}")
    List<Map> getStockInfo(String stock_status, String stock_num);
}